<?php
  define('QTY',100);
  define('COLS',5);
  $rows = ceil( QTY / COLS );
  $count =1;

$t1 = microtime();
echo '
<table align="center"  border="1" width="80%">
  <thead>
    <tr>
      <th colspan="'.COLS.'">Table Heading</th>
    </tr>
  </thead>

  <tbody>';


 for($i=1 ; $i<=$rows ; $i++) {
      $color = $i % 2 == 0 ? 'yellow':'lightgreen';

echo '<tr>';
       for ($j = 1; $j <= COLS ; $j++) {

        if($count <= QTY){
echo
        '<td style="background:'.$color.'">'.$count++.'</td>';
       } else {// end if()
echo
        '<td style="background:'.$color.'">&nbsp;</td>';

        }//end else
      }// end for for $j
echo '</tr>';
    }// end for for $i
echo '</tbody>

</table>';

echo "<br><br>";
echo microtime() - $t1;
